#include "AppState.h"
#include "AppStateManager.h"
#include "Parameters.h"
#include "stdincl.h"

AppStateSplashScreen::AppStateSplashScreen()    {}
AppStateSplashScreen::~AppStateSplashScreen()   {}

void AppStateSplashScreen::OnActivate()
{
    //
}

void AppStateSplashScreen::OnDeactivate()
{
    //
}

void AppStateSplashScreen::OnLoop(sf::RenderWindow& window)
{
    window.clear(sf::Color(255, 255, 255, 255));

    sf::Font font;
    font.loadFromFile("fonts/FerroRosso.ttf");
    sf::Text text("Splashscreen");
    text.setFont(font);
    text.setColor(sf::Color::Black);
    text.setCharacterSize(40);
    text.setPosition(Parameters::GetScreenWidth() / 3, 10.0f);
    window.draw(text);

    window.display();

    sf::Event event;
    while (true)
    {
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::MouseButtonPressed)
            {
                AppStateManager::GetInstance()->SetActiveAppState(AppState::DisplayMandelbrot);
            }

            if (event.type == sf::Event::Closed)
                window.close();
                return;
        }
    }
}





